package cn.itcast.bos.service.base.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.base.StandardDao;
import cn.itcast.bos.domain.base.Standard;
import cn.itcast.bos.service.base.StandardService;
@Service
@Transactional
public class StandardServiceImpl implements StandardService {
	@Autowired
	private StandardDao standardDao;
	@Override
	
	public void add(Standard standard) {
		// TODO Auto-generated method stub
		standardDao.save(standard);
	}
	public void findByName(String name){
		List<Standard> findByname = standardDao.findByName("1");
		System.out.println(findByname);
	}
	
	public void updateMinLength(Integer id,Integer length){
		standardDao.updateStandardMinLength(id, length);
	}
	@Override
	public Page<Standard> findPageData(Pageable pageable) {
		// TODO Auto-generated method stub
		Page<Standard> findAll = standardDao.findAll(pageable);
		return findAll;
	}
	@Override
	public List<Standard> findAll() {
		List<Standard> findAll = standardDao.findAll();
		return findAll;
	}
}
